package com.zd.commodity.categoryMng.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.zd.commodity.action.BaseAction;
import com.zd.commodity.categoryMng.biz.ICategoryMappingBiz;
import com.zd.commodity.categoryMng.entity.CategoryMapping;
@Scope("prototype")
@Controller
public class CategoryMappingAction extends BaseAction<CategoryMapping> {
	private ICategoryMappingBiz categoryMappingBiz;
	private CategoryMapping categoryMapping;
	
	public void addCategoryMapping(){
		try {
			categoryMappingBiz.add(categoryMapping);
			write(ajaxReturn(true,"添加成功！",null));
		} catch (Exception e) {
			write(ajaxReturn(false,"添加失败！",null));
			e.printStackTrace();
		}
	}
	
	public String showCategoryTree(){
		return "showCategoryTree";
	}
	public String showCategoryMain(){
		return "showCategoryMain";
	}

	public ICategoryMappingBiz getCategoryMappingBiz() {
		return categoryMappingBiz;
	}

	public CategoryMapping getCategoryMapping() {
		return categoryMapping;
	}
	
	public void setCategoryMapping(CategoryMapping categoryMapping) {
		this.categoryMapping = categoryMapping;
	}
	@Autowired
	public void setCategoryMappingBiz(ICategoryMappingBiz categoryMappingBiz) {
		this.categoryMappingBiz = categoryMappingBiz;
		this.setBaseBiz(categoryMappingBiz);
	}
	
}
